using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.Hospitalization
{
    /// <summary>
    /// 费用表
    /// </summary>
    [Table("Fee")]
    public class Fee
    {
        /// <summary>
        /// 费用记录唯一标识,主键,自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int FeeId { get; set; }

        /// <summary>
        /// 关联住院登记表的外键
        /// </summary>
        [Required]
        public int AdmissionId { get; set; }

        /// <summary>
        /// 交款金额(单位:元)
        /// </summary>
        [Required]
        [Column(TypeName = "decimal(10,2)")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 剩余金额(单位:元)
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal RemainingAmount { get; set; }

        /// <summary>
        /// 已用金额(单位:元)
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal UsageAmount { get; set; }

        /// <summary>
        /// 记录创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;

        /// <summary>
        /// 逻辑删除、默认false未删除 true已删除
        /// </summary>
        public bool IsDelete { get; set; } = false;

        /// <summary>
        /// 导航属性 - 关联住院登记表
        /// </summary>
        [ForeignKey("AdmissionId")]
        public virtual PatientAdmission? PatientAdmission { get; set; }
    }
} 